package top.huhuiyu.springboot3.exception;

/**
 * 自定义异常信息
 *
 * @author 胡辉煜
 */
public class AppException extends RuntimeException {
    private int code = 500;

    public int getCode() {
        return code;
    }

    public AppException(String message) {
        super(message);
    }

    public AppException(String message, int code) {
        super(message);
        this.code = code;
    }

    public static AppException create(String message) {
        return new AppException(message);
    }

    public static AppException create(String message, int code) {
        return new AppException(message, code);
    }

}
